package com.mmall.common;

import com.google.common.collect.Sets;

import java.util.Set;

public class Const {
    public static final String CURRENT_USER="currentUser";
    public static final String EAMIL="email";
    public static final String  USERNAME="username";

    public interface ProductListOrderBy{
        Set<String> PRICE_ASC_DESC = Sets.newHashSet("price_desc","price_asc");
    }

    public interface Role{
        int ROLE_CUSTOMER=0;//普通用户
        int ROLE_ADMIE=1;//管理员
    }

    public interface Cart{
        int CHECKED = 1;//即购物车选中状态
        int UN_CHECKED=0;//购物车中未选中状态

        String LIMIT_NUM_FAIL ="LIMIT_NUM_FAIL";
        String LIMIT_NUM_SUCCESS="LIMIT_NUM_SUCCESS";
    }

    public enum ProductStatusEnum{
        ON_SALE(1,"在线");

        private int code;
        private String value;

        ProductStatusEnum(int code,String value){
            this.code=code;
            this.value=value;
        }

        public int getCode() {
            return code;
        }

        public String getValue() {
            return value;
        }
    }

    public enum PayPlatforEnum{
        ALIPAY(1,"支付宝");

        private Integer code;
        private String value;

        PayPlatforEnum(int code,String value){
            this.code=code;
            this.value=value;
        }
        public Integer getCode() {
            return code;
        }
        public String getValue() {
            return value;
        }
    }

    public enum PaymentTypeEnum{
        ONLINE_PAY(1,"在线支付");

        private int code;
        private String value;

        PaymentTypeEnum(int code,String value){
            this.code=code;
            this.value=value;
        }
        public Integer getCode() {
            return code;
        }
        public String getValue() {
            return value;
        }
    }

}
